package vm.machine;

public class JeInstruction extends  AbstractInstruction{
    int value;
    int address;

    JeInstruction(Machine machine, int value,int address){
        super(machine);
        this.value = value;
        this.address = address;
    }
    @Override
    public void doAction() {
    }

    @Override
    public void nextPc() {
        if(machine.getRegister("flag").getValue() > 0){
            machine.getRegister("pc").setValue(address);
        }else{
            super.nextPc();
        }
    }
    @Override
    public String toString() {
        return "执行Je指令";
    }
}
